import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class java5 {
    public static void main(String[] args) {
        int[] arr1={1,2,3};
        int[] arr2={3,4,5,2};
        Map<Integer,Integer> map=new HashMap<>();
        for (int i = 0; i < arr1.length ; i++) {
            int key = arr1[i];
            if (map.containsKey(key)) {
                int n = map.get(key);
                map.put(key, n + 1);
            } else {
                map.put(key, 1);
            }
        }
        for (int j = 0; j < arr2.length ; j++) {
            int key2 = arr2[j];
            if (map.containsKey(key2)) {
                int n = map.get(key2);
                map.put(key2, n + 1);
            } else {
                map.put(key2, 1);
            }
            System.out.println(map);
        }
        map.entrySet().stream().filter(s->s.getValue()==1).forEach(s-> System.out.println(s.getKey()));
    }

}

